package com.mouse.remind;

import java.util.HashMap;


public class MapBean extends Entity {
	private HashMap<String, String> map = null;
	private boolean checked;

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public HashMap<String, String> getMap() {
		return map;
	}

	public void setMap(HashMap<String, String> map) {
		this.map = map;
	}
	
	public void put(String key, String value){
		if(map == null)
			map = new HashMap<String, String>();
		map.remove(key);
		map.put(key, value);
	}
	
	public String get(String key){
		if(map == null)
			return "";
		String value = map.get(key);
		return value == null ? "" : value;
	}
	
	public int getInt(String key){
		if(map == null)
			return 0;
		return StringUtil.toInt(map.get(key));
	}
	
	public boolean getBoolean(String key){
		if(map == null)
			return false;
		return StringUtil.toBoolean(map.get(key));
	}
	
	public long getLong(String key){
		if(map == null)
			return 0;
		return StringUtil.toLong(map.get(key));
	}
}
